package PlaneGame.CODE;

import java.awt.*;
import static PlaneGame.CODE.GameFrame.*;
public  class Supply extends AutoBorn{
    int twinkleRate=50,twinkleR=0;

    public Supply() {
        super();
        this.speed=1;
    }
    @Override
    void draw(Graphics g) {
        twinkle(g);
    }
    void twinkle(Graphics g){
        if (twinkleR>twinkleRate) {
            twinkleR=-twinkleRate;
        }else {
            if (on_off&&!suspendFlag) {
                twinkleR++;
            }
        }
        if(twinkleR>0){
            g.drawImage(images[drawPos],x,y,width,height,null);
        }
    }
    @Override
    void touch() {
        super.touch();
        if(mrW.contain((this.x+this.width/2),(this.y+this.height/2))){
            buff();
            this.off();
        }
    }
    void buff(){

    }
}
